package com.springboot.redis.controller;

import com.springboot.redis.stream.PublisherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("stream")
@RestController
public class StreamController {

    @Autowired
    private PublisherService publisherService;

    @GetMapping("{topic}/{key}/{value}")
    public String send(@PathVariable String topic, @PathVariable String key, @PathVariable String value){

        this.publisherService.send(topic, key, value);

        return "SUCCESS";
    }

}
